package com.dbky.alg.controller;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: tianchao
 * @Date: 2021/12/11 23:03
 * @Description:
 */
@RestController
public class UserController {
    @GetMapping("me")
    public Object me(){
        return SecurityContextHolder.getContext().getAuthentication();
    }
    @GetMapping("me2")
    public Object me2(Authentication authentication){
        return authentication;
    }
}
